Hi , I need guidance for completing my script for automating DOORS word functionality. Objective : 1. To export a Module to Word document 2. Update the header (header and footer) of the document with module properties like Module Name and Version No. 3. Save the document in a particular folder. I want to run this script on all the Module sheets in a folder also. (batch run) I was successfull in developing a script to export and save need to achieve other objectives. DXLScriptingInfo - Fri Jul 04 02:00:49 EDT 2014 |
Re: Automating DOORS WORD export functionality I am confident that is is far better to insist that no instance of Word is running when you start. Using Word manually while DOORS exports to Word in the background is just begging for trouble. This thread shows how to invoke the native word.dxl file, that exports the module. If you need to adjust word file headers and footers, you will need to use OLE automation. I suspect the above file leaves handle "objDocTemp" as a handle on the word document; but you can also just "get" the active "Document". From there you need to get a handle on the "Header" and modify its contents, then the "Footer" and modify its contents. Somewhere in there you use the "SaveAs" method on the "Document". Good luck, I'd rather pass a gall stone then work with OLE automation. -Louie |
Re: Automating DOORS WORD export functionality llandale - Mon Jul 07 11:24:59 EDT 2014 I am confident that is is far better to insist that no instance of Word is running when you start. Using Word manually while DOORS exports to Word in the background is just begging for trouble. This thread shows how to invoke the native word.dxl file, that exports the module. If you need to adjust word file headers and footers, you will need to use OLE automation. I suspect the above file leaves handle "objDocTemp" as a handle on the word document; but you can also just "get" the active "Document". From there you need to get a handle on the "Header" and modify its contents, then the "Footer" and modify its contents. Somewhere in there you use the "SaveAs" method on the "Document". Good luck, I'd rather pass a gall stone then work with OLE automation. -Louie On a side note: Many years ago my partner developed a superior Word exporter; using modifications of word.dxl. He had a special Word template file created that had document Headers/Footers/Cover page and TOC already defined. A key feature was that he would read certain module only attributes and set their value as "Variables" (I think) in the template. e.g. set module attributes "Document Name" and "Document Revision" to corresponding variables in Word. The Template was designed to display the variable at certain places, such as the cover page and the footer. He thus managed to export picture perfect word documents. As I recall, you only had to tweak some of the table formats before the document was ready for document control baselining. Somewhere I saved the DXL which is now OBE (it was for DOORS v4), but never saved the corresponding Word template file. -Louie |
Re: Automating DOORS WORD export functionality llandale - Mon Jul 07 11:24:59 EDT 2014 I am confident that is is far better to insist that no instance of Word is running when you start. Using Word manually while DOORS exports to Word in the background is just begging for trouble. This thread shows how to invoke the native word.dxl file, that exports the module. If you need to adjust word file headers and footers, you will need to use OLE automation. I suspect the above file leaves handle "objDocTemp" as a handle on the word document; but you can also just "get" the active "Document". From there you need to get a handle on the "Header" and modify its contents, then the "Footer" and modify its contents. Somewhere in there you use the "SaveAs" method on the "Document". Good luck, I'd rather pass a gall stone then work with OLE automation. -Louie As Louie says - make sure no instance of Word is running before you start. This includes Outlook! While the exporter is running, do not try to do anything else on the PC. Tony |
Re: Automating DOORS WORD export functionality llandale - Mon Jul 07 11:33:31 EDT 2014 On a side note: Many years ago my partner developed a superior Word exporter; using modifications of word.dxl. He had a special Word template file created that had document Headers/Footers/Cover page and TOC already defined. A key feature was that he would read certain module only attributes and set their value as "Variables" (I think) in the template. e.g. set module attributes "Document Name" and "Document Revision" to corresponding variables in Word. The Template was designed to display the variable at certain places, such as the cover page and the footer. He thus managed to export picture perfect word documents. As I recall, you only had to tweak some of the table formats before the document was ready for document control baselining. Somewhere I saved the DXL which is now OBE (it was for DOORS v4), but never saved the corresponding Word template file. -Louie Thanks for the input :-) As I need to get the header of the word document updated on priority, I am planning put a place holder in the cutomised word template for Module Name and Version which I can find and replace using dxl after the export is done on a customised template and before saving of document is done. Is this approach feasible ? Is there any script or code which is available for find and replace functionality which I can use for reference? |
Re: Automating DOORS WORD export functionality What version of DOORS are you using? There's always the infamous WEXP if using an older version. It works for me on DOOR 8.2, but I am not sure about later versions... |
Re: Automating DOORS WORD export functionality mcnairk - Wed Jul 23 14:09:56 EDT 2014 What version of DOORS are you using? There's always the infamous WEXP if using an older version. It works for me on DOOR 8.2, but I am not sure about later versions... I am working with DOORS 9.3 Version. |
Re: Automating DOORS WORD export functionality DXLScriptingInfo - Wed Jul 23 23:26:13 EDT 2014 I am working with DOORS 9.3 Version. Anyone know if WEXP will work in 9.3? Also, would it be prodcutive to try out? I have no expereince in running WEXP in batch mode... |
Re: Automating DOORS WORD export functionality mcnairk - Thu Jul 24 08:16:40 EDT 2014 Anyone know if WEXP will work in 9.3? Also, would it be prodcutive to try out? I have no expereince in running WEXP in batch mode... Yes it does work (my favoured export method). It's part of RMF (was TREK). |